/*
 * SonarQube
 * Copyright (C) 2009-2017 SonarSource SA
 * mailto:info AT sonarsource DOT com
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 3 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */
@import (reference) "../variables";
@import (reference) "../mixins";
@import (reference) "../components/ui";


// Top Level

html, body {
  color: @baseFontColor;
}

body {
  font-family: @baseFontFamily;
  font-size: @baseFontSize;
  line-height: @baseLineHeight;
}


// Headers

.header(@h) {
  line-height: @formControlHeight;
  color: ~"@{@{h}-font-color}";
  font-size: ~"@{@{h}-font-size}";
  font-weight: ~"@{@{h}-font-weight}";

  img, svg {
    vertical-align: middle;
    transform: translateY(-1px);
  }
}

h1, .h1 { .header(h1); }
h2, .h2 { .header(h2); }
h3, .h3 { .header(h3); }
h4, .h4 { .header(h4); }
h5, .h5 { .header(h5); }
h6, .h6 { .header(h6); }


// Superset & Subset

sup { vertical-align: text-top; }
sub { vertical-align: text-bottom; }


// Emphasising

em     { font-style: italic; }
strong { font-weight: 600; }

mark {
  background: none;
  font-weight: bold;
}

.emphasised-measure {
  font-size: 24px;
  font-weight: 300;
}


// Quotes

blockquote {
  border-left: 3px solid @barBorderColor;
  padding: 0 8px;
  line-height: 1.5;
}

blockquote cite {
  line-height: 1.5;
  color: @secondFontColor;
  font-size: @smallFontSize;
}


// Size

small,
.small { font-size: (100% * (@smallFontSize / @baseFontSize)); }

.big   { font-size: (100% * (@bigFontSize / @baseFontSize)); }

.zero-font-size { font-size: 0 !important; }


// Alignment

.text-left    { text-align: left; }
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-justify { text-align: justify; }

.text-top     { vertical-align: top; }
.text-middle  { vertical-align: middle; }
.text-bottom  { vertical-align: bottom; }


// Overflow

.text-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-limited {
  display: inline-block;
  max-width: 16vw;
  .text-ellipsis;
}


// Transformation

.text-uppercase    { text-transform: uppercase; }
.text-lowercase    { text-transform: lowercase; }
.text-no-transform { text-transform: none; }

.text-normal { font-weight: normal; }


// Color

.text-emphasis-variant(@color) { color: @color; }
.text-muted   { .text-emphasis-variant(@secondFontColor); }
.text-muted-2 { .text-emphasis-variant(@middleGrey); }
.text-danger  { .text-emphasis-variant(@red); }
.text-warning { .text-emphasis-variant(@orange); }
.text-info    { .text-emphasis-variant(@blue); }
.text-success { .text-emphasis-variant(@green); }


// Font

.monospaced {
  line-height: @monoLineHeight;
  font-family: @monoFontFamily;
  font-size: @monoFontSize;
}
